package com.myjar.excel.v2;

import org.apache.poi.ss.usermodel.Row;

public class POiRow implements _Row {

    private Row row;

    public POiRow(Row row) {
        this.row = row;
    }

    @Override
    public _Cell getCell(int index) {
        return new POiCell(row.getCell(index));
    }

    @Override
    public _Cell createCell(int index) {
        return new POiCell(row.createCell(index));
    }

    @Override
    public int cellSize() {
        return isNull() ? 0 : row.getPhysicalNumberOfCells();
    }

    @Override
    public boolean isNull() {
        return row == null;
    }
}
